<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<div class="main-content">
    <div class="box box-main">
        <form id="inputForm" model="post" action="<c:url value="/web/admin/position/addOrUpdate.action"/>"
              method="post" enctype="multipart/form-data" class="form-horizontal">
            <div class="box-body">
                <div class="form-unit">基本信息</div>
                <input name="id" value="${positon.id}" type="hidden">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label class="control-label col-sm-4" title="">
                                <span class="required ">*</span> 岗位编号：<i class="fa icon-question hide"></i></label>
                            <div class="col-sm-8">
                                <input path="postCode111" name="code" value="${positon.code}" disabled placeholder="系统自动生成"
                                       maxlength="64" class="form-control required"/>
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-12">
                        <div class="form-group">
                            <label class="control-label col-sm-4" title="">
                                <span class="required ">*</span> 岗位名称：<i class="fa icon-question hide"></i></label>
                            <div class="col-sm-8">
                                <input path="postCode111" name="name" value="${positon.name}"
                                       maxlength="64" class="form-control required"/>
                            </div>
                        </div>
                    </div>

                </div>

            </div>
            <input id="typeValue" value="${type}" type="hidden">
            <div class="box-footer">
                <div class="row">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i>
                            保 存
                        </button>&nbsp;

                        <button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="closeView()"><i
                                class="fa fa-times"></i> 关 闭
                        </button>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
<script>
    $("#inputForm").validate({
        submitHandler: function (form) {
            js.ajaxSubmitForm($(form), function (data) {
                // console.log(data);
                js.showMessage(data.msg);
                if (data.status == Global.NO) {
                    closeView();
                    $('#dataGrid').dataGrid("refresh");
                }
            }, "json");
        }
    });

    function closeView() {
        layer.close(LayWin['wPosition']);
    }

</script>


